<%--
 *  File:    ForumReceiver.jsp
 *  @Author: Kent Zhong
 *  Date:    2002/04/23
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>


<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.ForumReceiver");
%>

<% //--------------------------------------  variant and initialization --%>
<%
	String strModuleName = "BIEE";
  	String strTableName = "ovforum";
	String privilegeCode = "Z0401";

  	//get current userinfo
  	HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");
  	String forumid=new String("");
    if(request.getParameter("forumid")!=null)
    {
       forumid=(String) request.getParameter("forumid");
    }
%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title>ForumEdit</title>
<PageFlow:CheckPageFlow pageName="p_forumreceiver"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="../js/FuncLib.js"></script>
<script language="JavaScript" src="../js/Calendar.js"></script>
<script language="JavaScript" src="../js/ScriptLib.js"></script>

<script language="JavaScript" >


    function page_orgselect()
    {
        window.open("CompanyMultiSelectPop.jsp?<%= OvalTools.randomURL() %>", "pop1", "height=200, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no");
    }

    function checkDate(_date0, _date, message)
    {
       var frm = document.forumeditform;
       var date0 = eval("document.forumeditform." + _date0);
       var date = eval("document.forumeditform." + _date);
       date.value = dateCheck(date0.value, 'yyyy-MM-dd', '<%=JspHelper.filterNull( session.getAttribute("dateformat") )%>');
       if ( date.value < 0 )
       {
           alert(message);
           date0.focus();
       }
    }

    function Empty_check(checkobj,strMessage)
    {
        var obj = eval("document.forumeditform." + checkobj);
        if(isEmpty(obj.value))
        {
            alert(strMessage);
            obj.focus();
        }
    }

    function page_save()
    {
        var blSave=true;
        if(!checkNull(document.forumeditform))return;
        if(blSave)
        {
            MLCSTransform(document.forumeditform);
            document.forumeditform.actionname.value = "done";
            document.forumeditform.target = "_parent";
            isRunning = true;
            document.forumeditform.submit();
        }
        else
            return;
    }

 function setParent(strorglist)
    {
        if ( isEmpty(document.forumeditform.toorglist.value) )
            document.forumeditform.toorglist.value=strorglist;
        else
            document.forumeditform.toorglist.value+=","+strorglist;
        var remote = window.open("","pop1");
        if (remote != null)
            remote.close();
    }

var popwindow;
function page_mulilang(name,label,num,need)
{
  var forumid=document.forumeditform.forumid.value;
  if(popwindow!=null)
    popwindow.close();
  var strurl="../common/Lang.jsp?<%= OvalTools.randomURL() %>&form=forumeditform&module=BIEE&mlctype="+label+"&nativelanguage="+need+"&schema=ovforumlang&entityid="+forumid+"&entitytype="+name+"&contentid=forumlangid&colindex="+num;
  var strStatus= "height=250, width=250,top=100,left=100,toolbar=n0, menubar=no, scrollbars=no, resizable=no, location=no, status=no";
  popwindow=window.open(strurl, "newwindow",strStatus);
}
<%--[SCRIPT]    [SCRIPT]--%>
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="forumeditform" method="post" action="../Dispatcher"  target="_parent"  ENCTYPE="multipart/form-data">
    <input type="hidden" name="pagename" value="p_forumreceiver">
    <input type="hidden" name="actionname">
    <input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
    <INPUT type="hidden" name=forumid>

<%

    Vector allbusarea=(Vector)pageContext.getAttribute("allbusarea");
    if(allbusarea==null)
    {
        allbusarea=new Vector();
    }

    Vector allorggroup=(Vector)pageContext.getAttribute("allorggroup");
    if(allorggroup==null)
    {
        allorggroup=new Vector();
    }

     HashMap foruminfo=(HashMap)pageContext.getAttribute("foruminfo");
        if(foruminfo==null)
        {
            foruminfo=new HashMap();
        }

    Integer IntAreaId=(Integer)foruminfo.get("areaid");
    if(IntAreaId==null)
    {
        IntAreaId=new Integer(-1);
    }
    int areaid=IntAreaId.intValue();

     Integer IntOrgGroupId=(Integer)foruminfo.get("orggroupid");
    if(IntOrgGroupId==null)
    {
        IntOrgGroupId=new Integer(-1);
    }
    int orggroupid=IntOrgGroupId.intValue();
%>
  <input type="hidden" name="numrows" value="2">

  <input type="hidden" name="orgid" value="<%=JspHelper.filterNull(CurUserInfo.get("orgid"))%>">
  <input type="hidden" name="status" value="10">
  <input type="hidden" name="maker" value="<%=JspHelper.filterNull(CurUserInfo.get("userid"))%>">

<table width="100%" cellspacing="0" cellpadding="0">
  <%--form name="form1" method="post" action="../ordermanagement/oe/NewSalesOrderMain.htm"--%>
    <tr>
      <td valign="top">

        	<%
          		String strTextTypeCN = "td-text";
          		String strTextTypeEN = "td-text";
          		String strNullCN = "Y";
          		String strNullEN = "Y";
          		if(strLanguageCode.equalsIgnoreCase("cn"))
          		{
            		strTextTypeCN = "need";
            		strNullCN = "N";
            	}
          		if(strLanguageCode.equalsIgnoreCase("en"))
          		{
            		strTextTypeEN = "need";
            		strNullEN = "N";
            	}

        	%>


        <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="1">
          <tr>
            <td colspan="4" class="deepblue-left" height="22"> <img src="../images/<%= strLanguageCode %>/quote.gif">
              &nbsp;<%=label.getLabelName("L_Addressee")+label.getLabelName("L_Colon")%> </td>
          </tr>
          <tr>
            <td  class="td-text">&nbsp;<%=label.getLabelName("L_Region")+label.getLabelName("L_Colon")%></td>
            <td  width="266">
              &nbsp;<select name="areaid">
              <option value="">--------------</option>
                <logic:iterate id="allbusareaitem" collection="<%= allbusarea %>">
                <%
                        HashMap hmTemp=(HashMap)pageContext.getAttribute("allbusareaitem");
                        if(hmTemp==null)
                        {
                            hmTemp=new HashMap();
                        }
                        Integer oAreaid=(Integer)hmTemp.get("areaid");
                        if(oAreaid==null)
                        {
                            oAreaid=new Integer(-1);
                        }
                        int nAreaid=oAreaid.intValue();
                        String strSelected="";
                        if(nAreaid==areaid)
                            strSelected="Selected";
                    %>
                    <%if(forumid!=null){%>
                    <option value='<oval:write name="allbusareaitem" property="areaid"/>' <%=JspHelper.filterNull(strSelected)%>><oval:write name="allbusareaitem" property="areaname"/></option>
                    <%} else {%>
                    <option value='<oval:write name="allbusareaitem" property="areaid"/>' ><oval:write name="allbusareaitem" property="areaname"/></option>
                     <%}%>
                </logic:iterate>
              </select>
            </td>
            <td class="td-text"  >&nbsp;<%=label.getLabelName("L_OrgGroup")+label.getLabelName("L_Colon")%></td>
            <td  width="277">
              &nbsp;<select name="orggroupid">
                <option value="">--------------</option>
                <logic:iterate id="allorggroupitem" collection="<%= allorggroup %>">
                <%
                        HashMap hmTemp=(HashMap)pageContext.getAttribute("allorggroupitem");
                        if(hmTemp==null)
                        {
                            hmTemp=new HashMap();
                        }
                        Integer oOrgGroupid=(Integer)hmTemp.get("orggroupid");
                        if(oOrgGroupid==null)
                        {
                            oOrgGroupid=new Integer(-1);
                        }
                        int nOrgGroupid=oOrgGroupid.intValue();
                        String strSelected="";
                        if(nOrgGroupid==orggroupid)
                            strSelected="Selected";
                    %>
                   <%if(forumid!=null){%>
                     <option value='<oval:write name="allorggroupitem" property="orggroupid"/>' <%=JspHelper.filterNull(strSelected)%>><oval:write name="allorggroupitem" property="groupname"/></option>
                    <%} else {%>
                    <option value='<oval:write name="allorggroupitem" property="orggroupid"/>' ><oval:write name="allorggroupitem" property="groupname"/></option>
                    <%}%>
                </logic:iterate>
              </select>
            </td>
          </tr>
          <tr>
            <td class="td-text">&nbsp;<%=label.getLabelName("L_Org")+label.getLabelName("L_Colon")%></td>
            <td colspan="3">
              &nbsp;<custom:textarea name="foruminfo" property="toorglist" cols="88" rows="6" />
<%--<textarea name="toorglist" cols="88" rows="6" ></textarea>--%>
            </td>
          </tr>
        </table>

      </td>
    </tr>

    <tr>
                        <td style="display:none">
                            <custom:hidden property="forumid" />
                        </td>
      </tr>

    <tr>
      <td class="summary_top"></td>
    </tr>
    <tr>
      <td class="td_center">
      <a onclick="page_orgselect();"><custom:button type="1" label="L_SelectCompany" imgsrc="SelectCompany.gif" border="0" style="width:60"/></a>
      <a onclick="page_save();"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a>
      <a onclick="history.go(-1);"><custom:button type="1" label="L_Cancel" imgsrc="cancel.gif" border="0" style="width:60"/></a></td>
    </tr>

</table>
</form>
</body>
</html>


